
//
// vbinds
// 区区电脑
// 2023 年 02 月 01 日 09:45
import {hasPermission, adminHasPermission, hasPagePermission, adminHasPagePermission} from "./permission"


export default function registerVBinds(app) {
    app.directive("permission", {
        mounted: function (el, { value }) {
            if (!hasPermission(value)) el.remove()
        }
    })
    app.directive("adminPermission", {
        mounted: function (el, { value }) {
            if (!adminHasPermission(value)) el.remove()
        }
    })
    app.directive("pagePermission", {
        mounted: function (el, { value }) {
            if (!hasPagePermission(value)) el.remove()
        }
    })
    app.directive("adminPagePermission", {
        mounted: function (el, { value }) {
            if (!adminHasPagePermission(value)) el.remove()
        }
    })
}
